Cleanup main model: Clean all includes and make some components to be forward declared#1142
Cleanup main model: Clean all includes and make some components to be forward declared#1142nitbharambe wants to merge 42 commits intomainfrom
Conversation
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
|
I like the cleanup. Now I wonder, should we move In addition, can we also include |
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
|
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
figueroa1395
left a comment
There was a problem hiding this comment.
One additional thing is that perhaps #1142 (comment) is still relevant. Also, maybe triggering Copilot for review might be useful since missing things for a human due to the nature of this PR is very easy.
Rest looks good, just minor questions.
power_grid_model_c/power_grid_model/include/power_grid_model/common/three_phase_tensor.hpp
Show resolved
Hide resolved
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
figueroa1395
left a comment
There was a problem hiding this comment.
I'm a fan of this! I just left a couple remarks.
| #include "meta_data.hpp" | ||
|
|
||
| #include "../common/common.hpp" | ||
| #include "../common/counting_iterator.hpp" |
There was a problem hiding this comment.
As pointed out by the CI, add this via Jinja instead of directly editing here.
|
|
||
| #include "../common/common.hpp" | ||
| #include "../common/enum.hpp" |
|
|
||
| #include <doctest/doctest.h> | ||
|
|
||
| // NOLINTBEGIN(misc-include-cleaner) |
There was a problem hiding this comment.
I see many of these, probably related to nlohmann/json. Shouldn't we instead exclude it via misc-include-cleaner.IgnoreHeaders as we did with Eigen?
| ] | ||
| } | ||
| })json"s; | ||
| })json"s; // NOLINT(misc-include-cleaner) https://github.com/llvm/llvm-project/issues/98122 |
There was a problem hiding this comment.
These are annoying but I guess there is nothing else to do about them...
| auto const& attribute_name = MetaData::attribute_name(attribute_meta); | ||
| // TODO need a way for common angle: u angle skipped for now | ||
| if (attribute_name == "u_angle"s) { | ||
| if (attribute_name == "u_angle"s) { // NOLINT(misc-include-cleaner) |
There was a problem hiding this comment.
Missed adding github issue name there. Same as others. Its with operator s
| auto const& node = meta_map.get_component("node"); | ||
| auto const& node_attr = node.attributes; | ||
| CHECK(node_attr[0].name == "id"s); | ||
| CHECK(node_attr[0].name == "id"s); // NOLINT(misc-include-cleaner) |
There was a problem hiding this comment.
Why are these a problem here?
| #include <power_grid_model/common/exception.hpp> | ||
| #include <power_grid_model/common/grouped_index_vector.hpp> | ||
| #include <power_grid_model/common/three_phase_tensor.hpp> | ||
| #include <power_grid_model/math_solver/short_circuit_solver.hpp> // NOLINT(misc-include-cleaner) |
There was a problem hiding this comment.
Is it asking to directly import things called in the short circuit module? Or what's the issue?
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
Signed-off-by: Nitish Bharambe <nitish.bharambe@alliander.com>
There was a problem hiding this comment.
I find clangd giving a lot more insights than microsoft c++. It spotted many of the cleaned up things of header files which is not possible via clang-tidy.
There was a problem hiding this comment.
I will bring up configuration in a knowledge sharing session.
There was a problem hiding this comment.
in that case, maybe add the extension to the workspace recommendations?
|



Idea is to make components forward declared to reduce coupling.
This draft PR is created for gathering thoughts and requirements as of now.
Changes proposed in this PR include:
We shall maintain include discipline from now. Include order would be:
For include / source files
For tests:
In general, use <> for external. "" for internal. Note: PGM includes in test are treated as external, hence they go as <>.